<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title>连接数据库</title>
    </head>
    <body>
        <?php
        $host="127.0.0.1";
        $user="root";
        $password="";
        $database="db_bbs";
        $port="3306";
        $db=new mysqli($host, $user, $password,$database,$port);
            
       
    if ($db->connect_error) {
    die("连接失败! 出错的原因为: " . $conn->connect_error);
} 
 else {
    echo "连接成功";
}

        ?>
    </body>
</html>
